home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / ACE / utils / ACEcalc / ACEcalc.doc < prev    next >
Text File  |  1994-10-22  |  4KB  |  144 lines

  1.  
  2.                 -------------------
  3.                 ACEcalc version 1.0
  4.                 ------------------- 
  5.  
  6.                     by
  7.  
  8.                 David J. Benn, September 1994
  9.  
  10.  
  11. CONTENTS
  12. --------
  13. ° General Description
  14. ° Order of Operations
  15. ° Accuracy of Calculations
  16. ° Error Messages
  17. ° Inside the Program
  18. ° Problems/Limitations
  19. ° Contacting the Author
  20.             
  21.  
  22. General Description
  23. -------------------
  24. ACEcalc is Workbench calculator which allows for the construction and
  25. evaluation of fixed-point infix expressions.
  26.  
  27. Legal operators are: +,-,*,/,^ corresponding to addition, subtraction,
  28. multiplication, division, exponentiation. Two additional operators: (
  29. and ) allow sub-expressions to be parenthesised.
  30.  
  31. Unary functions currently provided are: SIN, COS, TAN, LOG, EXP, SQR,
  32. and INT which correspond to sine, cosine, tangent (these expect radians),
  33. natural logarithm, e raised to the power of n, square root and integer
  34. conversion with rounding. All functions take a single argument.
  35.  
  36. Expressions are entered either by clicking buttons on the calculator 
  37. with the mouse, or by using the Amiga's keyboard. In the latter case,
  38. the return/enter key has the same effect as "=", and the destructive
  39. backspace and Del keys correspond to the "«-" button on the calculator.
  40.  
  41. Note that all buttons in the first four rows have keyboard equivalents,
  42. but that none in the last two rows do.
  43.  
  44. There are three other calculator buttons of note: CLR, STO, RCL. The
  45. first clears the calculator's display. STO stores the current expression
  46. (shown in the calculator's display). RCL retrieves the most recently
  47. stored expression and displays it. There is only a single memory. In
  48. order to clear the memory, select CLR and STO in sequence.
  49.  
  50. Typical ACEcalc usage is somthing like this (comments in curly braces):
  51.  
  52.     (12+2)*3.5        {enter this expression}
  53.     =            {"=" button or keyboard equivalent}
  54.     49            {result appears in display}
  55.     STO            {store 49}
  56.     CLR            {clear the display}
  57.     SIN(            {enter "SIN("}
  58.     RCL            {recall memory contents}
  59.     )            {closing parenthesis}
  60.     =            {"=" button or keyboard equivalent}
  61.     -0.9537535        {result of SIN(49) appears in display}
  62.     
  63. The project menu has items for an About box and quitting. The program
  64. may be exited by selecting the latter from the Project menu, hitting
  65. Amiga-Q or clicking the calculator's close button.
  66.  
  67. Note that the calculator window may be dragged around the screen and
  68. depth arranged.
  69.  
  70.  
  71. Order of Operations
  72. -------------------
  73. Expression evaluation proceeds from left to right, with operation
  74. precedence as follows:
  75.  
  76.     1.     ()    
  77.     2.     SIN,COS,TAN,LOG,EXP,SQR,INT
  78.     3.    ^
  79.     4.    *,/
  80.     5.    +,-
  81.  
  82.  
  83. Accuracy of Calculations
  84. ------------------------
  85. Since ACEcalc only uses single-precision floating point math, the accuracy
  86. of results is limited to around 8 integer digits or 7 decimal places, and 
  87. beyond that, digits should be treated with suspicion.
  88.  
  89. A big advantage of single-precision math (Motorola FFP in this case) is
  90. that it's fast. However, when ACE (see "Inside the program") supports 
  91. double-precision (IEEE) floating point math, so will ACEcalc.
  92.  
  93.    
  94. Error Messages
  95. --------------
  96. If an expression is malformed and cannot meaningfully be evaluated,
  97. ACEcalc displays the message: SYNTAX ERROR.
  98.  
  99. If a divisor evaluates to zero the DIVISION BY ZERO message is displayed.
  100.  
  101. You should never see the STACK OVERFLOW or STACK UNDERFLOW messages. Let 
  102. me know if you do.
  103.  
  104.  
  105. Inside the Program
  106. ------------------
  107. ACEcalc was written in ACE BASIC, a freeware AmigaBASIC compiler (developed 
  108. by yours truly).
  109.  
  110. The calculator relies heavily upon ACE's GUI capabilities for the
  111. creation and handling of menus, buttons etc.
  112.  
  113. The expression evaluation engine is a recursive descent parser.
  114.  
  115.  
  116. Problems/Limitations
  117. --------------------
  118. ° Topaz 8 is assumed to be the default screen font. A future version of
  119.   ACEcalc will rescale calculator elements according to the screen font
  120.   set in Preferences.
  121.  
  122. ° While ACEcalc displays exponential format numbers when a result is
  123.   too large to be displayed in fixed point format, such results can
  124.   not be used as components in subsequent calculations.
  125.  
  126.     
  127. Contacting the Author
  128. ---------------------
  129. You can reach me in a number of ways:
  130.  
  131.     Internet:    D.Benn@appcomp.utas.edu.au
  132.     
  133.     CompuServe:    100033,605
  134.  
  135.     Phone:        (003) 317 680 [AH]
  136.             (003) 243 529 [wk]    
  137.  
  138.     Snail Mail:    181 St John Street,
  139.             Launceston, Tasmania,
  140.             Australia, 7250
  141.  
  142.  
  143.                 (*---oOo---*)
  144.